<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>{$current['title']}-{$Think.CONFIG.sitename}</title>

    <link href="__PUBLIC__/static/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="__PUBLIC__/static/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="__PUBLIC__/static/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="__PUBLIC__/static/css/animate.min.css" rel="stylesheet">
    <include file="Public/commoncss" />
    <!-- Sweet Alert -->
    <link href="__PUBLIC__/static/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
</head>

<body class="gray-bg top-navigation">
<div id="wrapper">
    <div id="page-wrapper" class="gray-bg">
        <div class="row border-bottom white-bg">
            <include file="Public/header" />
        </div>
        <div class="wrapper wrapper-content">
            <div class="row">
                <div class="col-sm-3">
                    <div class="ibox float-e-margins">
                        <include file="Public/sidenav" />
                    </div>
                </div>
                <div class="col-sm-9 animated fadeInRight">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title"><h4>我的收藏夹</h4></div>
                        <div class="ibox-content">

                            <div class="row row-lg">


                                <div class="col-sm-12">
                                    <!-- Example Toolbar -->
                                    <div class="example-wrap">
                                        <!--<h4 class="example-title">工具条</h4>-->
                                        <div class="example">

                                            <div class="bootstrap-table">
                                                <div class="fixed-table-toolbar">
                                                    <div class="bars pull-left">
                                                        <div class="btn-group hidden-xs" id="exampleToolbar" role="group">
                                                            <button type="button" class="btn btn-outline btn-default" onclick="window.location.href='{:U(add)}'">
                                                                <i class="glyphicon glyphicon-plus" aria-hidden="true"></i>
                                                            </button>
                                                            <button type="button" class="btn btn-outline btn-default"  data-toggle="modal" data-target="#delModal" id="get-ids">
                                                                <i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
                                                            </button>
                                                        </div>
                                                    </div>
                                                    <form action="" method="get">
                                                        <div class="columns columns-right btn-group pull-right">
                                                            <button class="btn btn-default btn-outline" type="submit"  title="查找">
                                                                <i class="glyphicon glyphicon-search"></i>
                                                            </button>
                                                        </div>
                                                        <div class="pull-right search">
                                                            <input class="form-control input-outline" placeholder="搜索" type="text" name="keyword" value="{$_GET['keyword']}">
                                                        </div>
                                                    </form>

                                                </div>
                                                <div class="fixed-table-container" style="padding-bottom: 0px;">
                                                    <div class="fixed-table-body">
                                                        <table id="exampleTableToolbar" data-mobile-responsive="true" class="table table-hover">
                                                            <thead>
                                                            <tr>
                                                                <th >
                                                                    <div class="th-inner ">
                                                                        <input type="checkbox" class="check-all">全选
                                                                    </div>
                                                                    <div class="fht-cell">
                                                                    </div>
                                                                </th>
                                                                <th  >
                                                                    <div class="th-inner ">
                                                                        序号
                                                                    </div>
                                                                    <div class="fht-cell">
                                                                    </div>
                                                                </th>
                                                                <th  >
                                                                    <div class="th-inner ">
                                                                        名字
                                                                    </div>
                                                                    <div class="fht-cell">
                                                                    </div>
                                                                </th>
                                                                <th >
                                                                    <div class="th-inner ">
                                                                        创建时间
                                                                    </div>
                                                                    <div class="fht-cell">
                                                                    </div>
                                                                </th>
                                                                <th >
                                                                    <div class="th-inner ">
                                                                        标记
                                                                    </div>
                                                                    <div class="fht-cell">
                                                                    </div>
                                                                </th>
                                                                <th  >
                                                                    <div class="th-inner ">
                                                                        操作
                                                                    </div>
                                                                    <div class="fht-cell">
                                                                    </div>
                                                                </th>
                                                            </tr>
                                                            </thead>
                                                            <tbody>
                                                            <volist name="list" id="val" empty="没有找到匹配的记录">
                                                                <tr >
                                                                    <td class="center">
                                                                        <input class="ids" type="checkbox" name="id[]" value="{$val['id']}">
                                                                    </td>
                                                                    <td class="center">{$i}</td>
                                                                    <td class="center"><a href="{:U('view')}?id={$val.id}">{$val.name|SearchWords=$_GET['keyword']}</a></td>
                                                                    <td class="center">{$val.time|beenTime}</td>
                                                                    <td class="center">
                                                                        <if condition="$val['status'] neq 0">
                                                                            <a href="javascript:;" class="stu" val="{$val.id}">
                                                                                <i class="fa fa-star-half-o red-bg"></i>
                                                                                <i class="fa fa-star-half-o red-bg"></i>
                                                                                <i class="fa fa-star-half-o red-bg"></i>
                                                                                <i class="fa fa-star-half-o red-bg"></i>
                                                                                <i class="fa fa-star-half-o red-bg"></i>
                                                                            </a>
                                                                         <else />
                                                                            <a href="javascript:;" class="stu" val="{$val.id}">
                                                                                <i class="fa fa-star-half-o"></i>
                                                                                <i class="fa fa-star-half-o"></i>
                                                                                <i class="fa fa-star-half-o"></i>
                                                                                <i class="fa fa-star-half-o"></i>
                                                                                <i class="fa fa-star-half-o"></i>
                                                                            </a>
                                                                        </if>
                                                                    </td>
                                                                    <td class="center">
                                                                        <a class="blue" href="{:U('edit',array('id'=>$val['id']))}" title="编辑"><i class="ace-icon fa fa-pencil-square-o bigger-100"></i>编辑</a>&nbsp;&nbsp;
                                                                        <a class="red del" href="javascript:void(0);" val="{$val['id']}" title="删除"><i class="ace-icon fa fa-trash bigger-100"></i>删除</a>
                                                                    </td>
                                                                </tr>
                                                            </volist>
                                                            </tbody>
                                                        </table>
                                                    </div>

                                                </div>
                                            </div>
                                            <div class="clearfix"></div>
                                        </div>
                                    </div>
                                    <!-- End Example Toolbar -->
                                </div>
                                <div class="col-sm-12">
                                    <!-- Example Pagination -->
                                    <div class="example-wrap">
                                        {$page}
                                    </div>
                                    <!-- End Example Pagination -->
                                </div>

                            </div>


                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--删除提示模态框-->
        <div class="modal inmodal fade" id="delModal" tabindex="-1" role="dialog"  aria-hidden="true">
            <div class="modal-dialog modal-sm">
                <form action="{:U('del')}" role="form" id="delForm">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                            <h4 class="modal-title">友情提示</h4>
                        </div>
                        <div class="modal-body">
                            <p id="delTips">确定删除这些用户组吗？</p>
                        </div>
                        <div class="modal-footer">
                            <input type="hidden" name="ids" id="del-ids" value="">
                            <button type="button" class="btn btn-white" data-dismiss="modal">让我想想</button>
                            <button type="submit" class="btn btn-danger btn-sm"> 是的！ </button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
        <include file="Public/footer" />
    </div>
</div>
<include file="Public/commonjs" />
<script src="__PUBLIC__/static/js/bootstrap.min.js?v=3.3.5"></script>
<script src="__PUBLIC__/static/js/content.min.js?v=1.0.0"></script>
<script src="__PUBLIC__/static/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="__PUBLIC__/static/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
<script src="__PUBLIC__/static/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="__PUBLIC__/static/js/demo/bootstrap-table-demo.min.js"></script>
<script src="__PUBLIC__/static/js/plugins/validate/Validform_v5.3.2.js"></script>
<script src="__PUBLIC__/static/js/plugins/sweetalert/sweetalert.min.js"></script>
<script type="text/javascript">
    (function($) {
        //全选按钮
        $(".check-all").click(function () {
            $(".ids").prop("checked", this.checked);
        });
        //获取ids的json数组
        $("#get-ids").click(function(){
            var data = getJson('id[]');
            $("#del-ids").val(data);
        })
        //单个删除
        $('.del').click(function () {
            var id= $(this).attr("val");
            swal({
                title: "您确定删除这个收藏夹",
                text: "删除后将无法恢复！",
                type: "info",
                showCancelButton: true,
                confirmButtonColor: "#DD6B55",
                cancelButtonText:"取消",
                confirmButtonText: "确定",
                closeOnConfirm: false
            }, function () {
                $.post("{:U('del')}",{ids:'{"ids":"'+id+'"}'},function(data){
                    if(data.status !== 'y'){
                        swal('操作失败!', "参数错误原因可能是程序没有获取到参数！", "warning");
                    }else{
                        window.location.reload();
                    }
                });
            });
        });
        //单个标记
        $('.stu').click(function () {
            var id= $(this).attr("val");

                $.post("{:U('stu')}",{id:id},function(data){
                    if(data.status !== 'y'){
                        swal('操作失败!', "参数错误原因可能是程序没有获取到参数！", "warning");
                    }else{
                        window.location.reload();
                    }
                });

        });
        //删除
        $("#delForm").Validform({
            tiptype:function(msg,o,cssctl){
                if(!o.obj.is("form")){
                    var objtip=o.obj.find("#delTips");
                    cssctl(objtip,o.type);
                    objtip.text(msg);
                }else{
                    if(msg == '恭喜操作成功！'){
                        window.location.reload();
                    }else{
                        var objtip=o.obj.find("#delTips");
                        cssctl(objtip,o.type);
                        objtip.text(msg);
                    }
                }
            },
            ajaxPost:true
        });
    })(jQuery);
</script>
</body>

</html>